# Bmp2DHR – A Utility for Converting Modern Graphics to Apple II Graphics

# Introducing Bmp2DHR Version 1.0

Bmp2DHR Version 1.0 (c) Copyright Bill Buckels 2014. All Rights Reserved.

Usage: "b2d input.bmp options"

Input format: mono, 16 color, 256 color, or 24-bit Version 3 uncompressed BMP

Default DHGR Colored Output: Full Screen Apple II A2FC file

Optional Usage: "b2d input.bmp hgr options"

For HGR Colored Output: Full Screen Apple II BIN file

Optional Usage: "b2d input.bmp mono options"

For Mono Output: Full Screen Apple II DHGR A2FM or HGR BIN file

Free Scaled Input Sizes: Full Screen (default) or DHGR Sprite (option F) output

Full Scale: from 1 x 1 to 140 x 192 (default) - HGR and DHGR

Half Scale: from 1 x 1 to 280 x 192 (scaling option S2) - HGR and DHGR

HGR and DHGR Fixed Scaled Input Sizes: Full Screen Output (default)

140 x 192 - Full Scale (for LGR use 40 x 48, for DLGR use 80 x 48)

280 x 192 - Double Width Scale (for LGR and DLGR use 160 x 96)

320 x 200 - Classic Size (also used for LGR and DLGR windowboxed output)

560 x 384 - Quadruple Width, Double Height Scale (also for LGR and DLGR)

640 x 400 - Classic Size (also used for LGR and DLGR mixed screen output)

640 x 480 - Classic Size (also used for LGR and DLGR full screen output)

Full Screen Dithered Output (optional): Option D (D1 to D9)

Optional Usage: "b2d input.bmp L (or DL) options"

For Color LGR or DLGR Full Screen or Mixed Screen (option "TOP") Output.

See documentation for more information including additional input size info.

Original Image – 24-bit BMP – scaled and cropped | Bmp2DHR conversion – DHGR – Sheldon Simms Colors, Buckels Dither
Bmp2DHR conversion – DHGR Monochrome - Buckels Dither | Bmp2DHR conversion – HGR – Sheldon Simms Colors, Buckels Dither

Bmp2DHR converts monochrome, 16 color, 256 color, or 24 bit Version 3 uncompressed BMP files (without color-space info), to standard Apple II Hi-res Graphics (HGR) files, Double Hi-Res Graphics (DHGR) files, or Lo-Res Graphics (LGR) and Double Lo-Res Graphics (DLGR) files that can be loaded in a DOS 3.3 or ProDOS program written in BASIC or C (including Apple II graphics editors and paint programs). Bmp2DHR is a command-line utility written in Ansi C . It runs in text-mode, and comes with source code, so it is portable and can run on almost every modern computer on The Planet. It has been compiled and run in MS-DOS and on Windows, Linux, and Mac OSX. It was written for educational purposes (and “for the hellery of it”), uses “standard parts” combined with original code written by its primary author (Bill Buckels) and others (see attributions in the source code and documentation), and has only one main restriction; you must agree that its primary author and the other “contributors” are not liable in any way for its use and distribution (see licence agreement), and the use and distribution of its documentation, demos, and the other related baggage that it comes with.

Bmp2DHR is not a simple utility; it has many options, including rendering options, and DHGR “Sprite” output options, but for simple-minded output like the examples shown here its use is also simple. It is not “bloat-ware” (it doesn’t “pack” a GUI in its “belly” with “buttons and bells and whistles”); its memory requirements are modest (it doesn’t “gobble-up” files and processes a line at a time, and it compiles in 16-bit Turbo C or MicroSoft C and runs in MS-DOS as well as on modern systems, so “that tells you something”), and it runs relatively quickly. All of its code is internal so it does not need any “special libraries” for its use (or to compile “the thing”).

And Bmp2DHR is actively developed and not some old non-portable program with “second or third-rate” output that takes forever to run and advertises its slow speed as a feature. In this day and age Bmp2DHR works as expected, with immediate processing and usually with acceptable results, despite that it is not particularly modern or innovative since it is primarily built using technology that has been around since about the time the Apple II was introduced.

# Download Bmp2DHR

Version 1.0 Documentation, Case Studies, Demos, Extras and Tutorials Page: Coming Soon.

Win32 and latest version complete with source: http://www.appleoldies.ca/cc65/programs/dhgr/bmp2dhr.zip

MS-DOS: http://www.appleoldies.ca/cc65/programs/dhgr/bmp2dhrMSDOS.zip

Other: (Linux, OSX): http://hoop-la.ca/apple2/appleoldies/bmp2dhr/

# Double Lo-Res and Lo-Res Conversion in Bmp2DHR

Although the Apple II offers Lo-Res Graphics (LGR) and Double Lo-Res Graphics (DLGR), these graphics modes are very coarse and really not very suitable for displaying converted content from continuous palette images. The converted output from these generally looks like enlarged icons or thumbnail images. For the most part LGR and DLGR input files converted from pixel-art BMPs (created by methods like coloring converted “Old PrintShop” or “Mini-Pix” files) will work better.

Bmp2DHR conversion – DLGR Buckels Dither | Bmp2DHR conversion – DLGR Buckels Dither
Bmp2DHR conversion – DLGR Buckels Dither | Bmp2DHR conversion – DLGR – Not Dithered (Minipix Conversion)

# The Best HGR and DHGR Converters on the Planet

I’d like to say Bmp2DHR is the best and I usually do.

No converter that provides Apple II HGR and DHGR output will always produce the best output on The Planet. However, some converters or conversion methods will consistently produce worse results than others, ranging from “middle of the road” to unsatisfactory.

Based on output quality alone the “Best DHGR Converter on The Planet” today (and in the history of the Apple II) is between Sheldon Simms tohgr and Bmp2DHR, from what I can see. I converted and compared hundreds of images with both during my testing of Bmp2DHR so I do not come to this conclusion without some effort.

In my experience, Jason Harper’s converters represent the best that the Apple II generally had to offer for HGR and DHGR conversion (and pseudo-conversion). Results vary but are generally unsatisfactory when compared to output from Bmp2DHR or from Sheldon Simms tohgr converter. Even The GIMP is better. In recent years, due to the ongoing efforts of Apple IIe “retro-developers” like me, “the bar has been raised” considerably for Apple IIe Graphics converters. But until we resurrected HGR and DHGR, I saw nothing more advanced than “][gif” and Super Convert despite the fact that the “standard parts” in our converters existed long before now.

Original Image | Sheldon Simms tohgr – DHGR | Bmp2DHR – DHGR – tohgr Palette
Jason Harper’s “][gif” – DHGR | Brendan Robert – DHGR – Jace Palette | Cybernesto VBMP (The GIMP- Munafo Palette)

From the time of the introduction of the Apple II and HGR in 1977, and continuing for about a decade, Apple II bitmapped graphics files were primarily “hand-built” in a graphics editor or a paint program. Digital photos and the other true-color graphics of today did not generally exist. A decade later, the 256 color GIF file format became popular, along with Jason Harper’s “][gif” file viewer which provided conversion of GIF files to HGR and DHGR files. Apple Computer had the technology available internally by that time to have developed a graphics converter capable of the same quality of output as Bmp2DHR, but in a world increasingly filled with graphics in GIF format from the larger IBM-PC market, Apple II users depended instead on third party developers like Jason Harper “flying solo” with his own graphics rendering in the “twilight” of the Apple II aftermarket.

The Buckels error-diffusion dithering shown in the Bmp2DHR examples (command option D9) is only one of the 9 built-in dithers in Bmp2DHR (including Floyd-Steinberg and Atkinson), and is a “classic” dithering pattern based on Apple Computer’s own Atkinson Dithering which predates DHGR but with a full color bleed like Floyd-Steinberg. Bmp2DHR also provides optional user-definable error diffusion dithering. The others (with the exception of “][gif”) all use error-diffusion dithering which predates HGR.

Jason Harper’s “][gif” – HGR | Sheldon Simms tohgr – HGR | Bmp2DHR – HGR – tohgr DHGR Palette
Jason Harper’s “][gif” – DHGR - Monochrome | Bmp2DHR – DHGR – 25% Reduced Color Bleed | Bmp2DHR – HGR – 25% Reduced Color Bleed

Jason Harper’s later effort, Super Convert which ran on the Apple IIgs, did not provide conversion to HGR and DHGR files but provided conversion to other file formats like GIF using an HGR or DHGR color palette based on the IIgs RGB display; the same colors used by the kegs32 emulator. Bmp2DHR can create HGR and DHGR files from Super Convert’s conversions (how this is done is elsewhere in the Bmp2DHR documentation). Super Convert 4 was released the same year that Multi-Media Windows 3.1 was released on the IBM-PC. By that time true-color VGA cards like the ATI Wonder XL were already in wide use in “the wild”, and error-diffusion dithering was already “old news”. Although Windows 3.1 provided ordered (positional) dithering for economy and legacy displays, by that time it was seldom seen in “mainstream” PC graphics.

Jason Harper’s Super Convert - HGR | Super Convert – HGR – Monochrome Palette | Bmp2DHR – HGR – Full Color Bleed
Jason Harper’s Super Convert - DHGR | Super Convert – DHGR – Monochrome Palette | Bmp2DHR – DHGR – Full Color Bleed

Jason Harper’s Super Convert - DHGR | Sheldon Simms tohgr – DHGR | Bmp2DHR – DHGR – tohgr DHGR Palette
Jason Harper’s Super Convert - HGR | Sheldon Simms tohgr – HGR | Bmp2DHR – HGR – tohgr DHGR Palette

Super Convert provides error-diffusion dithering in Monochrome only, and something called “patterned dithering” for color output. Like The GIMP today, only Floyd-Steinberg is offered by Super Convert as its single error-diffusion dither. Super Convert does not even have a reduced color bleed option so The GIMP has “half a leg up” over Super Convert.

Bmp2DHR with its full color bleed control and import of user-definable dithering in addition to its 9 built-in dithers for color or monochrome output makes a modest comparison impossible even with The GIMP. A color error diffusion dither would have been quite an improvement for “][gif” or Super Convert. Since Super Convert already had Monochrome error diffusion dithering in place and it takes at most a couple of days to write a complete color error diffusion dithering routine like the several used in Bmp2DHR, it’s too bad this was never done when it could have been useful to more people.

# Outlawing HGR

Brendan Robert’s Outlaw Editor - HGR | Sheldon Simms tohgr - HGR | Bmp2DHR – HGR
Original Image | Sheldon Simms tohgr - DHGR | Bmp2DHR – DHGR

Brendan Robert’s Outlaw Editor - HGR | Sheldon Simms tohgr - HGR | Bmp2DHR - HGR
Original Image | Sheldon Simms tohgr - DHGR | Bmp2DHR – DHGR

Brendan Robert’s Outlaw Editor - HGR | Sheldon Simms tohgr - HGR | Bmp2DHR - HGR
Original Image | Sheldon Simms tohgr - DHGR | Bmp2DHR – DHGR

Brendan Robert (Blurry) provides an example disk of HGR output from his Outlaw Editor. Three of the images from his example disk are shown above with the comparable HGR and DHGR output from Sheldon Simms tohgr and Bmp2DHR. Brendan Robert’s converter has a different purpose, uses a full matrix of 560 pixels wide unlike the other two which are based on “verbatim” resolution, and although his dithering seems to lack the detail of the other two, it is still in development (as are the other two) so a fair comparison will need to wait. It would be delightful if we didn’t need to wait too long.

But we don’t need to wait to compare the rest of the HGR and DHGR methodology or converters that I know about. The GIMP sees colors differently than either Bmp2DHR or tohgr, and provides marginally poorer results. Bmp2DHR directly provides optional VBMP output, so The GIMP’s dithering is not really needed. As far as I am concerned, The GIMP’s strength lies in its scaling and standard format conversion features so is an excellent companion to both Bmp2DHR and tohgr, which both require input files to be converted from other common formats into their respective input formats.

Bmp2DHR goes far beyond tohgr as far as options go. But tohgr is generally the “Best HGR Converter on the Planet” today but not always. Both converters are better than anything else that I have seen for HGR and DHGR conversion. Other recent efforts exist “out there” too, but can’t compare to these 4.

# Bmp2DHR in the Ghetto

This project deserves a mention. Three of the images from Osgeld’s Website are shown below with the comparable HGR and DHGR output from Bmp2DHR.

Osgeld’s Ghetto Converter - HGR | Bmp2DHR – HGR Monochrome |
Original Image | Bmp2DHR – DHGR Monochrome | Bmp2DHR – DHGR Color

Osgeld’s Ghetto Converter - HGR | Bmp2DHR – HGR Monochrome |
Original Image | Bmp2DHR – DHGR Monochrome | Bmp2DHR – DHGR Color

Osgeld’s Ghetto Converter - HGR | Bmp2DHR – HGR | Original Image

After all these years, Apple II users continue to attempt to display what should have been theirs to display all along, and could have been if the focus had been on providing them with the software that I believe has been attainable all along through the use of “standard parts” in Apple Computer’s “inventory”. I am convinced they could have done it if they wanted to! I am also told that WOZ still has thoughts about how he could have improved the design of the Apple II’s hardware display.

“I awoke one night in Quito, Ecuador, this year and came up with a way to save a chip or two from the Apple II, and a trivial way to have the 2 grays of the Apple II be different (light gray and dark gray) but it’s 38 years too late. It did give me a good smile, since I know how hard it is to improve on that design." - Steve Wozniak, 2014.

Bmp2DHR was written in my “spare time” in the 5 month period between August 2014 and December 2014, on the shores of Lake Winnipeg, much closer to the North Pole than Ecuador. It took more than one night and gave me more than one good smile, since it was so easy to improve on what was there before (with the exception of Sheldon Simms tohgr converter) simply by using “standard parts”. Unlike WOZ’s design of the Apple II display which is like perfection and is forever, there is much to improve on when it comes to Bmp2DHR and the other recent contenders for converting from Modern Graphics to Apple II Graphics Images with “real” Apple II Colors. Bmp2DHR Version 1.0 is just a start.

All the best,

Bill Buckels

bbuckels@mts.net

December 22, 2014